Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think it's really bad UX that the library lets you use unsupported
query
operators without any compile-time warning, and you have to look in the documentation to find out which ones are missing. People keep being surprised by that.Although it would obviously be ideal to implement
groupJoin
and the other missing ones, I figured that there could be a simpler solution first: provide asqlQuery
computation expression where the unsupported operators are simply not available.The
sql
builder in this PR is a dumb calque of the originalquery
CE. The queries are still regularIQueryables
so you can freely mix and matchsql
andquery
without issue (and it doesn't break existing code). As you can see, the tests that use unsupported operators become compile-time failures.Other safety improvements that could potentially be achieved through this CE:
!!
operator with a more intuitivenaturalJoin
operator, like this:but I'm having trouble making it work - it doesn't seem like
CustomOperationAttribute
lets you define an operator that is "likefor
". Plus I'm not sure if the!!
operator would even be correctly recognized by the code inSqlRuntime.Linq.fs
this wayjoin
is only used on supported targets, by wrappingQuerySource
in a SQL-specific wrapper class?Thoughts?